home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / misc / wclass20.zip / CPPHEAD.SCT < prev    next >
Text File  |  1995-01-16  |  5KB  |  150 lines

  1. // Class: CLASS        //ANSI C++
  2.  
  3. #ifndef __$TRUNCATE_EIGHT$CLASS$_H  //Required for current class
  4.   #define __$TRUNCATE_EIGHT$CLASS$_H
  5.  
  6. #ifndef __IOSTREAM_H        //Required for cin and cout
  7.   #include <iostream.h>            
  8. #endif
  9.  
  10. [                //Required for base classes
  11. #ifndef __$TRUNCATE_EIGHT$BASE_CLASS$_H
  12.   #include "TRUNCATE_EIGHT$BASE_CLASS$.h"
  13. #endif
  14. ]                
  15.                 
  16. [#include <INCLUDE_FILE>    //Required for include files
  17. ]                  
  18.  
  19. [                //Required for 1:1 associated classes
  20. #ifndef __$TRUNCATE_EIGHT$ASSOCIATION_ONE_CLASS$_H
  21.   #include "TRUNCATE_EIGHT$ASSOCIATION_ONE_CLASS.h"
  22. #endif
  23. ]                                
  24.  
  25. [                //Required for 1:1 aggregation (part) classes
  26. #ifndef __$TRUNCATE_EIGHT$AGGREGATION_ONE_CLASS$_H
  27.   #include "TRUNCATE_EIGHT$AGGREGATION_ONE_CLASS$.h"
  28. #endif
  29. ]                                
  30.  
  31. [                //Required for 1:M associated classes
  32. #ifndef __$TRUNCATE_EIGHT$ASSOCIATION_MANY_CLASS$_H
  33.   #include "TRUNCATE_EIGHT$ASSOCIATION_MANY_CLASS$.h"
  34. #endif
  35. ]                                
  36.  
  37. [                //Required for 1:M aggregation (part) classes
  38. #ifndef __$TRUNCATE_EIGHT$AGGREGATION_MANY_CLASS$_H
  39.   #include "TRUNCATE_EIGHT$AGGREGATION_MANY_CLASS$.h"
  40. #endif
  41. ]
  42.             
  43. class CLASS[NO_RETURN NO_REPEAT: NO_REPEAT public BASE_CLASS ,DELETE_LAST_SYMBOL] CLASS_LIBRARY_BASE_CLASS     
  44. { [ATTRIBUTE_TYPE ATTRIBUTE_NAME$;]
  45.   [ASSOCIATION_ONE_CLASS$* ASSOCIATION_ONE_NAME$;]
  46.   [AGGREGATION_ONE_CLASS AGGREGATION_ONE_NAME$;]
  47.   [ASSOCIATION_MANY_CLASS$* ASSOCIATION_MANY_NAME LITERAL_SYMBOL[6 LITERAL_SYMBOL];]
  48.   [AGGREGATION_MANY_CLASS AGGREGATION_MANY_NAME LITERAL_SYMBOL[6 LITERAL_SYMBOL];]
  49.  
  50. public:
  51.             //Default constructor
  52.             //Update to access base class attributes 
  53.             //Update to access 1:1 part class attributes 
  54.             //Update to access 1:M part class attributes
  55.             //Update to access 1:1 associated class attributes
  56.             //Update to access 1:M associated class attributes
  57.              //Ensure initial values entered
  58.   CLASS () :[NO_RETURN ATTRIBUTE_NAME(ATTRIBUTE_INITIAL_VALUE),DELETE_LAST_SYMBOL]  { } 
  59.  
  60.             //Constructor with arguments
  61.   CLASS ([NO_RETURN ATTRIBUTE_TYPE a$ATTRIBUTE_NAME,DELETE_LAST_SYMBOL] )    
  62.   : [NO_RETURN ATTRIBUTE_NAME (a$ATTRIBUTE_NAME),DELETE_LAST_SYMBOL] { }    
  63.             
  64.   
  65.             //Copy constructor
  66.             //Update to access 1:M part class attributes
  67.             //Update to access 1:1 associated class attributes
  68.             //Update to access 1:M associated class attributes     
  69.   CLASS (const CLASS$& a$CLASS ) [NO_RETURN NO_REPEAT: BASE_CLASS (a$CLASS),DELETE_LAST_SYMBOL]
  70.   { [  ATTRIBUTE_NAME = a$CLASS$.$ATTRIBUTE_NAME;]
  71.     [AGGREGATION_ONE_NAME = a$CLASS$.$AGGREGATION_ONE_NAME;]        
  72.   }                    
  73.  
  74.             //Operator= Assignment Operator
  75.             //Update to access 1:M part class attributes
  76.             //Update to access 1:1 associated class attributes
  77.             //Update to access 1:M associated class attributes     
  78.   CLASS operator= (const CLASS$& a$CLASS)
  79.   { if (this == &a$CLASS) return *this;         
  80.   [BASE_CLASS$::operator= (a$CLASS);]
  81.   [ATTRIBUTE_NAME = a$CLASS$.$ATTRIBUTE_NAME;]
  82.   [AGGREGATION_ONE_NAME = a$CLASS$.$AGGREGATION_ONE_NAME;]    
  83.   return *this;                                                    
  84.   }                    
  85.  
  86.             //Operator== Equality Operator
  87.             //Update to access 1:M part class attributes
  88.             //Update to access 1:1 associated class attributes
  89.             //Update to access 1:M associated class attributes     
  90.   int operator== (const CLASS$& a$CLASS)
  91.   { return (
  92. [  (BASE_CLASS$::operator== (a$CLASS)) &&]
  93. [  (AGGREGATION_ONE_NAME == a$CLASS$.$AGGREGATION_ONE_NAME) &&]
  94. [  (ATTRIBUTE_NAME == a$CLASS$.ATTRIBUTE_NAME) &DELETE_LAST_SYMBOL&DELETE_LAST_SYMBOL]
  95.   );
  96.   }                
  97.     
  98.             //Operator<< for cout 
  99.   friend ostream& operator<< (ostream& os, CLASS$& a$CLASS);
  100.  
  101.             //Operator<< for cin
  102.   friend istream& operator>> (istream& is, CLASS$& a$CLASS);
  103.                 
  104.             
  105. [              //Get accessor function for attribute
  106.   ATTRIBUTE_TYPE get$ATTRIBUTE_NAME$() const
  107.   {return ATTRIBUTE_NAME$;
  108.   }
  109. ]            
  110.             
  111. [              //Set accessor function for attribute
  112.   void set$ATTRIBUTE_NAME ($ATTRIBUTE_TYPE a$ATTRIBUTE_NAME$)
  113.   { ATTRIBUTE_NAME = a$ATTRIBUTE_NAME$;
  114.   }
  115. ]            
  116.  
  117. [              //Get accessor function for 1:1 aggregation
  118.   AGGREGATION_ONE_CLASS$& get$AGGREGATION_ONE_NAME$() 
  119.   {return AGGREGATION_ONE_NAME$;
  120.   }
  121. ]            
  122.             
  123. [              //Set accessor function for 1:1 aggregation
  124.   void set$AGGREGATION_ONE_NAME ($AGGREGATION_ONE_CLASS$& a$AGGREGATION_ONE_NAME$)
  125.   { AGGREGATION_ONE_NAME = a$AGGREGATION_ONE_NAME$;
  126.   }
  127. ]            
  128.  
  129. [              //Get accessor function for 1:1 association
  130.   ASSOCIATION_ONE_CLASS$* get$ASSOCIATION_ONE_NAME$() const
  131.   {return ASSOCIATION_ONE_NAME$;
  132.   }
  133. ]            
  134.             
  135. [              //Set accessor function for 1:1 association
  136.   void set$ASSOCIATION_ONE_NAME ($ASSOCIATION_ONE_CLASS$* a$ASSOCIATION_ONE_NAME$)
  137.   { ASSOCIATION_ONE_NAME = a$ASSOCIATION_ONE_NAME$;
  138.   }
  139. ]
  140.         
  141. [  CPP_OPERATION_VIRTUAL CPP_OPERATION_STATIC OPERATION_RETURN_TYPE OPERATION_NAME (CPP_OPERATION_PARAMETERS) CPP_OPERATION_CONSTANT CPP_OPERATION_PURE_VIRTUAL;
  142.  
  143.   ~ CLASS ( ) { }    //Destructor
  144. };
  145.  
  146. #endif
  147.  
  148.  
  149.